package com.fjrcloud.utils;

/**
 * Created by 林圣坚 on 2016/6/24.
 */
public enum StatusUtils {

    Normal("00000",""),

    Success("00050","操作成功"),

    NotLogin("10000","未登录"),

    NotAbility("20000","没有权限"),

    Fail("40000","操作失败"),
    CheckCodeFail("40010","无效验证码"),

    UploadFail("40010","上传操作失败"),
    FindFail("40020","查找失败，没有找到相关记录"),

    UpdateFail("40030","更新操作失败"),
    UpdateIdFail("40031","更新失败，缺少参数id"),
    UpdateFindFail("40032","更新失败，没有这条记录"),
    UpdateParameFail("40033","更新失败，传送的参数异常"),

    AddFail("40040","添加失败"),
    AddFail_NoCategory("40041","添加失败,没有相应的类型"),
    AddUserNameUnique("40050","用户名已经存在"),

    LoginUserNameError("50050","用户不存在"),
    PasswordError("50100","密码错误"),
    VerificationCodeError("50200","验证码错误"),

    GuestAbilityError("60000","游客不能进行该操作"),

    Unknown("99999","未知异常");

    private String code;
    private String value;

    StatusUtils(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public String getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    @Override
    public String toString() {
        return "StatusUtils{" +
                "code='" + code + '\'' +
                ", value='" + value + '\'' +
                '}';
    }
}
